<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style lang="less">
       body {
            font-family: Arial, sans-serif;
            background-color: #f2f2f2;
            margin: 0;
            padding: 0;
        }
        
        h1 {
            text-align: center;
            color: #333;
            margin: 20px 0;
        }
        
        table {
            margin: 20px auto;
            background-color: #fff;
            border-collapse: collapse;
            border: 1px solid #ccc;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        
        td {
            padding: 10px;
            border: 1px solid #ccc;
        }
        
        tr:nth-child(even) {
            background-color: #f2f2f2;
        }
        
        .btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #333;
            color: #fff;
            text-decoration: none;
            border-radius: 4px;
            transition: background-color 0.3s ease;
        }
        
        .btn:hover {
            background-color: #555;
        }
    </style>
</head>
<body>
    <h1 align="center">会员管理系统</h1>
    <?php
        require_once 'conn.php';
        $id = $_GET['id'];
        $result = mysqli_query($con,'select * from user where id='.$id);
        $user = mysqli_fetch_array($result,MYSQLI_ASSOC);
    ?>
    <table class="gridtable" width="444" align="center">
        <tr>
            <td>用户ID</td>
            <td>
                <?php
                    echo $id
                ?>
            </td>
        </tr>
        <tr>
            <td>用户名</td>
            <td>
                <?php
                    echo $user['name'];
                ?>
            </td>
        </tr>
        <tr>
            <td>密码</td>
            <td>
                <?php
                    echo $user['password'];
                ?>
            </td>
        </tr>
        <tr>
            <td>性别</td>
            <td>
                <?php
                    if($user['sex'] == '男'){
                        echo '男';
                    }
                    else if($user['sex'] == '女'){
                        echo '女';
                    }
                    else {
                        echo '保密';
                    }
                ?>
            </td>
        </tr>
        <tr>
            <td>年龄</td>
            <td>
                <?php
                    echo $user['age'];
                ?>
            </td>
        </tr>
        <tr>
            <td>爱好</td>
            <td>
                <?php
                    echo $user['hobby'];
                ?>
            </td>
        </tr>
        <tr>
            <td>个人简介</td>
            <td>
                <?php
                    echo $user['detail'];
                ?>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                    <a href="list.php" class="btn">返回用户列表</a>
            </td>
        </tr>
    </table>
</body>
</html>